﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using ZSZ.Core.Entities;

namespace ZSZ.EntityFramework.ModelConfig
{
    class AdminLogConfig: EntityTypeConfiguration<AdminLogEntity>
    {
        public override void Map(EntityTypeBuilder<AdminLogEntity> builder)
        {
            builder.ToTable("T_AdminLogs");
            builder.Property(e => e.Message).IsRequired();
            builder.HasOne(e => e.AdminUser).WithMany().HasForeignKey(e => e.AdminUserId).OnDelete(DeleteBehavior.ClientSetNull);
        }
    }


}
